]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Use space after catch
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jan 2019 01:26:39 +0000 (02:26 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Jul 2019 21:44:11 +0000 (23:44 +0200)
We are currently inconsistent with whether or not to put a space
after catch clauses. While the predominant style is to omit it,
that's inconsistent with the style we use for any other statement.
There's not really a good reason to stick with it, so switch to
the style gjs/eslint default to.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

26 files changed:
js/gdm/fingerprint.js
js/gdm/util.js
js/misc/extensionUtils.js
js/misc/ibusManager.js
js/misc/loginManager.js
js/misc/objectManager.js
js/misc/util.js
js/misc/weather.js
js/ui/appDisplay.js
js/ui/audioDeviceSelection.js
js/ui/calendar.js
js/ui/components/networkAgent.js
js/ui/components/polkitAgent.js
js/ui/components/telepathyClient.js
js/ui/endSessionDialog.js
js/ui/environment.js
js/ui/extensionDownloader.js
js/ui/extensionSystem.js
js/ui/ibusCandidatePopup.js
js/ui/magnifier.js
js/ui/notificationDaemon.js
js/ui/remoteSearch.js
js/ui/sessionMode.js
js/ui/status/keyboard.js
js/ui/status/network.js
js/ui/status/thunderbolt.js

index 5bf2becd5f02b03b84beef3cac13e7adf5e1c9e2..e27c7c1b1896455311e5496203ee9bba82eaa657 100644 (file)
@@ -23,7 +23,7 @@ function FprintManager() {
 
     try {
         self.init(null);
-    } catch(e) {
+    } catch (e) {
         log('Failed to connect to Fprint service: ' + e.message);
         return null;
     }
index 2e9935250be2964b2bb1bdcea70b883a7d680776..95f2e92e5b6fe3a7a1d0321dab105bf04017b854 100644 (file)
@@ -342,7 +342,7 @@ var ShellUserVerifier = class {
         try {
             this._clearUserVerifier();
             this._userVerifier = client.open_reauthentication_channel_finish(result);
-        } catch(e) {
+        } catch (e) {
             if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                 return;
             if (e.matches(Gio.DBusError, Gio.DBusError.ACCESS_DENIED) &&
@@ -369,7 +369,7 @@ var ShellUserVerifier = class {
         try {
             this._clearUserVerifier();
             this._userVerifier = client.get_user_verifier_finish(result);
-        } catch(e) {
+        } catch (e) {
             if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                 return;
             this._reportInitError('Failed to obtain user verifier', e);
@@ -429,7 +429,7 @@ var ShellUserVerifier = class {
                                                                (obj, result) => {
                try {
                    obj.call_begin_verification_for_user_finish(result);
-               } catch(e) {
+               } catch (e) {
                    if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                        return;
                    this._reportInitError('Failed to start verification for user', e);
@@ -444,7 +444,7 @@ var ShellUserVerifier = class {
                                                       (obj, result) => {
                try {
                    obj.call_begin_verification_finish(result);
-               } catch(e) {
+               } catch (e) {
                    if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                        return;
                    this._reportInitError('Failed to start verification', e);
index 51272e49c149b6f89feaa92868823c0f331d0dcc..908f9fd384581a2393280642fe2d553f887bdbdf 100644 (file)
@@ -235,7 +235,7 @@ var ExtensionFinder = class {
                                                        : ExtensionType.SYSTEM;
         try {
             extension = createExtensionObject(uuid, extensionDir, type);
-        } catch(e) {
+        } catch (e) {
             logError(e, 'Could not load extension %s'.format(uuid));
             return;
         }
index d20ad2f32a2ae5f6818a3421ffe67366c7a0ce2d..a01d31254692bca4aea2b752f5bbbe398b6b5b5b 100644 (file)
@@ -62,7 +62,7 @@ var IBusManager = class {
         try {
             Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'],
                                Gio.SubprocessFlags.NONE);
-        } catch(e) {
+        } catch (e) {
             log('Failed to launch ibus-daemon: ' + e.message);
         }
     }
@@ -138,7 +138,7 @@ var IBusManager = class {
                     engine = this._ibus.get_global_engine_async_finish(result);
                     if (!engine)
                         return;
-                } catch(e) {
+                } catch (e) {
                     return;
                 }
                 this._engineChanged(this._ibus, engine.get_name());
index 4f4cc836fb68e2030d887c94ca6853d4ce232c3e..1d2c35cf2061fbf23294af8421e41ff24db97817 100644 (file)
@@ -43,7 +43,7 @@ function canLock() {
 
         let version = result.deep_unpack()[0].deep_unpack();
         return haveSystemd() && versionCompare('3.5.91', version);
-    } catch(e) {
+    } catch (e) {
         return false;
     }
 }
@@ -185,7 +185,7 @@ var LoginManagerSystemd = class {
                     let [outVariant, fdList] = proxy.call_with_unix_fd_list_finish(result);
                     fd = fdList.steal_fds()[0];
                     callback(new Gio.UnixInputStream({ fd: fd }));
-                } catch(e) {
+                } catch (e) {
                     logError(e, "Error getting systemd inhibitor");
                     callback(null);
                 }
index cd531d39004b8c9110e7f447472b1f45bbde00e3..c57718df7cbf0cae62d66eadcac5ca23d1189e63 100644 (file)
@@ -94,7 +94,7 @@ var ObjectManager = class {
                          (initable, result) => {
                try {
                    initable.init_finish(result);
-               } catch(e) {
+               } catch (e) {
                    logError(e, 'could not initialize proxy for interface ' + interfaceName);
 
                    if (onFinished)
@@ -156,7 +156,7 @@ var ObjectManager = class {
     _onManagerProxyLoaded(initable, result) {
         try {
             initable.init_finish(result);
-        } catch(e) {
+        } catch (e) {
             logError(e, 'could not initialize object manager for object ' + this._serviceName);
 
             this._tryToCompleteLoad();
index d944367ce12c992101d335fafa08c1aab713eedf..9362f32ea365dfae94aba915b4cea1ed85a0544c 100644 (file)
@@ -93,7 +93,7 @@ function spawnApp(argv) {
 
         let context = global.create_app_launch_context(0, -1);
         app.launch([], context);
-    } catch(err) {
+    } catch (err) {
         _handleSpawnError(argv[0], err);
     }
 }
index e804bdee96970e4ff75a5993e6a33e81074d08c2..66d89fe9475ffc94059131073c04480178750f66 100644 (file)
@@ -178,7 +178,7 @@ var WeatherClient = class {
             (o, res) => {
                 try {
                     this._gclueService = Geoclue.Simple.new_finish(res);
-                } catch(e) {
+                } catch (e) {
                     log('Failed to connect to Geoclue2 service: ' + e.message);
                     this._setLocation(this._mostRecentLocation);
                     return;
index a06079619b40ac7299dd9b4d6ff5fbb79776a26d..b2226d3e353b65f9e14098431b0f29a3f5209ea6 100644 (file)
@@ -69,7 +69,7 @@ function _getFolderName(folder) {
         try {
             keyfile.load_from_data_dirs(path, GLib.KeyFileFlags.NONE);
             name = keyfile.get_locale_string('Desktop Entry', 'Name', null);
-        } catch(e) {
+        } catch (e) {
             return name;
         }
     }
@@ -359,7 +359,7 @@ var AllView = class AllView extends BaseAppView {
         this._appInfoList = Shell.AppSystem.get_default().get_installed().filter(appInfo => {
             try {
                 (appInfo.get_id()); // catch invalid file encodings
-            } catch(e) {
+            } catch (e) {
                 return false;
             }
             return appInfo.should_show();
index 2a83b7fdb5fd467420398877cbac05d5a39ae4cd..ef7930388d4af6e462a05884774230bd5f2bc079 100644 (file)
@@ -164,7 +164,7 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
         let dialog;
         try {
             dialog = new AudioDeviceSelectionDialog(devices);
-        } catch(e) {
+        } catch (e) {
             invocation.return_value(null);
             return;
         }
index 4996cfc3015047aed54fada53b026822693eff4a..c121e6bb6d210d4e2207a871eb32eff4e4f86f4d 100644 (file)
@@ -168,7 +168,7 @@ var DBusEventSource = class DBusEventSource {
             try {
                 this._dbusProxy.init_finish(result);
                 loaded = true;
-            } catch(e) {
+            } catch (e) {
                 if (e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
                     // Ignore timeouts and install signals as normal, because with high
                     // probability the service will appear later on, and we will get a
index bc653bc605d70112efaed2738747d5e270f9f381..03dc0f229589e94a03210c362a2ca8594ee0a206 100644 (file)
@@ -406,7 +406,7 @@ var VPNRequestHandler = class {
                                                     this._vpnChildFinished.bind(this));
 
             this._writeConnection();
-        } catch(e) {
+        } catch (e) {
             logError(e, 'error while spawning VPN auth helper');
 
             this._agent.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
@@ -423,7 +423,7 @@ var VPNRequestHandler = class {
         } else {
             try {
                 this._stdin.write('QUIT\n\n', null);
-            } catch(e) { /* ignore broken pipe errors */ }
+            } catch (e) { /* ignore broken pipe errors */ }
         }
 
         this.destroy();
@@ -472,7 +472,7 @@ var VPNRequestHandler = class {
             if (line == '' && this._previousLine == '') {
                 try {
                     this._stdin.write('QUIT\n\n', null);
-                } catch(e) { /* ignore broken pipe errors */ }
+                } catch (e) { /* ignore broken pipe errors */ }
             } else {
                 this._agent.set_password(this._requestId, this._previousLine, line);
                 this._previousLine = undefined;
@@ -560,7 +560,7 @@ var VPNRequestHandler = class {
                     this._agent.set_password(this._requestId, groups[i], value);
                 }
             }
-        } catch(e) {
+        } catch (e) {
             // No output is a valid case it means "both secrets are stored"
             if (data.length > 0) {
                 logError(e, 'error while reading VPN plugin output keyfile');
@@ -594,7 +594,7 @@ var VPNRequestHandler = class {
                 this._stdin.write('SECRET_VAL=' + (value || '') + '\n\n', null);
             });
             this._stdin.write('DONE\n\n', null);
-        } catch(e) {
+        } catch (e) {
             logError(e, 'internal error while writing connection to helper');
 
             this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
@@ -619,7 +619,7 @@ var NetworkAgent = class {
         try {
             let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
             monitor.connect('changed', () => { this._vpnCacheBuilt = false; });
-        } catch(e) {
+        } catch (e) {
             log('Failed to create monitor for VPN plugin dir: ' + e.message);
         }
 
@@ -631,7 +631,7 @@ var NetworkAgent = class {
             try {
                 this._native.init_finish(res);
                 this._initialized = true;
-            } catch(e) {
+            } catch (e) {
                 this._native = null;
                 logError(e, 'error initializing the NetworkManager Agent');
             }
index 8ce2667018874af9c1086a1bc12ebcd7076918f1..c32d52b0ff91d7f2d230b744609eb8e4eaa68032 100644 (file)
@@ -342,7 +342,7 @@ var AuthenticationAgent = class {
     enable() {
         try {
             this._native.register();
-        } catch(e) {
+        } catch (e) {
             log('Failed to register AuthenticationAgent');
         }
     }
@@ -350,7 +350,7 @@ var AuthenticationAgent = class {
     disable() {
         try {
             this._native.unregister();
-        } catch(e) {
+        } catch (e) {
             log('Failed to unregister AuthenticationAgent');
         }
     }
index 1292d9a00376ec99f3fcd3a532c8d6c32d6ff11a..6e81bab59451b21be048603f7c6505d5d3d95558 100644 (file)
@@ -8,7 +8,7 @@ var Tpl = null;
 var Tp = null;
 try {
     ({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
-} catch(e) {
+} catch (e) {
     log('Telepathy is not available, chat integration will be disabled.');
 }
 
index cdba84c03e0a895e28c695cd1fd062d9aeceded6..63e824578ceedba2dc6fe9ef7df829bc1d24a537 100644 (file)
@@ -155,7 +155,7 @@ function findAppFromInhibitor(inhibitor) {
     let desktopFile;
     try {
         [desktopFile] = inhibitor.GetAppIdSync();
-    } catch(e) {
+    } catch (e) {
         // XXX -- sometimes JIT inhibitors generated by gnome-session
         // get removed too soon. Don't fail in this case.
         log('gnome-session gave us a dead inhibitor: %s'.format(inhibitor.get_object_path()));
@@ -335,7 +335,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
 
         try {
             this._updatesPermission = Polkit.Permission.new_sync("org.freedesktop.packagekit.trigger-offline-update", null, null);
-        } catch(e) {
+        } catch (e) {
             log('No permission to trigger offline updates: %s'.format(e.toString()));
         }
 
index 573857126fb70197c4f6b0ba1702cb686af67657..c936c5b429b83c0d8defeaa3c95cbbeea60bb7b5 100644 (file)
@@ -114,7 +114,7 @@ function init() {
                 return base.replace(/\]$/, ' delegate for ' + this.actor.toString().substring(1));
             else
                 return base;
-        } catch(e) {
+        } catch (e) {
             return base;
         }
     };
index d86ae92afed8269f1483571cac00a7f74513fd22..4d414697ac33f3e0bc983f2cd4895314b3ad16ac 100644 (file)
@@ -127,7 +127,7 @@ function updateExtension(uuid) {
             try {
                 extension = ExtensionUtils.createExtensionObject(uuid, extensionDir, ExtensionUtils.ExtensionType.PER_USER);
                 ExtensionSystem.loadExtension(extension);
-            } catch(e) {
+            } catch (e) {
                 if (extension)
                     ExtensionSystem.unloadExtension(extension);
 
@@ -234,7 +234,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
             try {
                 let extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
                 ExtensionSystem.loadExtension(extension);
-            } catch(e) {
+            } catch (e) {
                 uninstallExtension(uuid);
                 errback('LoadExtensionError', e);
                 return;
index a53838d587fe5284b22da54e7f768420ad8bfc7c..983d7129e62ce4834ca7e95acb101d369fb8dfd0 100644 (file)
@@ -64,7 +64,7 @@ function disableExtension(uuid) {
         let uuid = orderReversed[i];
         try {
             ExtensionUtils.extensions[uuid].stateObj.disable();
-        } catch(e) {
+        } catch (e) {
             logExtensionError(uuid, e);
         }
     }
@@ -77,7 +77,7 @@ function disableExtension(uuid) {
 
     try {
         extension.stateObj.disable();
-    } catch(e) {
+    } catch (e) {
         logExtensionError(uuid, e);
     }
 
@@ -85,7 +85,7 @@ function disableExtension(uuid) {
         let uuid = order[i];
         try {
             ExtensionUtils.extensions[uuid].stateObj.enable();
-        } catch(e) {
+        } catch (e) {
             logExtensionError(uuid, e);
         }
     }
@@ -132,7 +132,7 @@ function enableExtension(uuid) {
         extension.state = ExtensionState.ENABLED;
         _signals.emit('extension-state-changed', extension);
         return;
-    } catch(e) {
+    } catch (e) {
         if (extension.stylesheet) {
             theme.unload_stylesheet(extension.stylesheet);
             delete extension.stylesheet;
@@ -208,7 +208,7 @@ function reloadExtension(oldExtension) {
     let newExtension;
     try {
         newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
-    } catch(e) {
+    } catch (e) {
         logExtensionError(uuid, e);
         return;
     }
@@ -235,7 +235,7 @@ function initExtension(uuid) {
     ExtensionUtils.installImporter(extension);
     try {
         extensionModule = extension.imports.extension;
-    } catch(e) {
+    } catch (e) {
         logExtensionError(uuid, e);
         return false;
     }
@@ -243,7 +243,7 @@ function initExtension(uuid) {
     if (extensionModule.init) {
         try {
             extensionState = extensionModule.init(extension);
-        } catch(e) {
+        } catch (e) {
             logExtensionError(uuid, e);
             return false;
         }
index fe421c557a504d85f8f71b77d5d234bdf526e68b..f51b78971d633d694877d60c8449b251f4c5b126 100644 (file)
@@ -181,7 +181,7 @@ var CandidatePopup = class CandidatePopup {
                 let window = global.display.focus_window.get_compositor_private();
                 this._setDummyCursorGeometry(window.x + x, window.y + y, w, h);
             });
-        } catch(e) {
+        } catch (e) {
             // Only recent IBus versions have support for this signal
             // which is used for wayland clients. In order to work
             // with older IBus versions we can silently ignore the
index fca06e206a349011537f73307c348586ff5bf771..0128d68d512ca8183664ca653b715870cec6e5a8 100644 (file)
@@ -798,7 +798,7 @@ var ZoomRegion = class ZoomRegion {
         let extents;
         try {
             extents = component.get_extents(Atspi.CoordType.SCREEN);
-        } catch(e) {
+        } catch (e) {
             log('Failed to read extents of focused component: ' + e.message);
             return;
         }
@@ -815,7 +815,7 @@ var ZoomRegion = class ZoomRegion {
         let extents;
         try {
             extents = text.get_character_extents(text.get_caret_offset(), 0);
-        } catch(e) {
+        } catch (e) {
             log('Failed to read extents of text caret: ' + e.message);
             return;
         }
index 4bdede841cb26231fdafb6adfdf52779cf966186..84147d41a59884cd0c2387bde09e045a090fc6e4 100644 (file)
@@ -759,7 +759,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
                 let source;
                 try {
                     source = this._ensureAppSource(appId);
-                } catch(e) {
+                } catch (e) {
                     if (e instanceof InvalidAppError)
                         return;
                     throw e;
@@ -793,7 +793,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
         let source;
         try {
             source = this._ensureAppSource(appId);
-        } catch(e) {
+        } catch (e) {
             if (e instanceof InvalidAppError) {
                 invocation.return_dbus_error('org.gtk.Notifications.InvalidApp', 'The app by ID "%s" could not be found'.format(appId));
                 return;
index ae6c6dab778636d915e30dfb7834b4bd3a2fed25..d17dad269786b1230cf09b44f569f11f41a4484d 100644 (file)
@@ -69,7 +69,7 @@ function loadRemoteSearchProviders(searchSettings, callback) {
 
         try {
             keyfile.load_from_file(path, 0);
-        } catch(e) {
+        } catch (e) {
             return;
         }
 
@@ -99,7 +99,7 @@ function loadRemoteSearchProviders(searchSettings, callback) {
             let autoStart = true;
             try {
                 autoStart = keyfile.get_boolean(group, 'AutoStart');
-            } catch(e) {
+            } catch (e) {
                 // ignore error
             }
 
@@ -118,13 +118,13 @@ function loadRemoteSearchProviders(searchSettings, callback) {
             remoteProvider.defaultEnabled = true;
             try {
                 remoteProvider.defaultEnabled = !keyfile.get_boolean(group, 'DefaultDisabled');
-            } catch(e) {
+            } catch (e) {
                 // ignore error
             }
 
             objectPaths[objectPath] = remoteProvider;
             loadedProviders.push(remoteProvider);
-        } catch(e) {
+        } catch (e) {
             log('Failed to add search provider %s: %s'.format(path, e.toString()));
         }
     }
index 70a6e8a15c0da7d38c74947601d948082f4daae8..2a75e9cb7367775cc88551bfcb4e9c45835ceda1 100644 (file)
@@ -120,7 +120,7 @@ function _loadMode(file, info) {
         if (fileContent instanceof Uint8Array)
             fileContent = imports.byteArray.toString(fileContent);
         newMode = JSON.parse(fileContent);
-    } catch(e) {
+    } catch (e) {
         return;
     }
 
index 17abe8a9248f456b2f5d2b820d55331310aa1b82..8215a5549e226196f3df009ce8ddef01ba365236 100644 (file)
@@ -199,7 +199,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
                                  let props;
                                  try {
                                      props = conn.call_finish(result).deep_unpack()[0];
-                                 } catch(e) {
+                                 } catch (e) {
                                      log('Could not get properties from ' + this._BUS_NAME);
                                      return;
                                  }
index 8ad451347e306d3df67e20291c8f1001048275ed..b47b27dc0ac9943bda0151d621944f9cd6703b8b 100644 (file)
@@ -1981,7 +1981,7 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
                     let state = client.check_connectivity_finish(result);
                     if (state >= NM.ConnectivityState.FULL)
                         this._closeConnectivityCheck(path);
-                } catch(e) { }
+                } catch (e) { }
             });
         } else {
             log('Invalid result from portal helper: ' + result);
index b36819a531489a15b2ece6d87ce4142d8d6effd2..728729812f9d5353638a80199d0fe271c641b875 100644 (file)
@@ -67,7 +67,7 @@ var Client = class {
     _onProxyReady(o, res) {
         try {
            this._proxy = Gio.DBusProxy.new_finish(res);
-        } catch(e) {
+        } catch (e) {
            log('error creating bolt proxy: %s'.format(e.message));
             return;
         }